#include "Bg.hpp"
#include "Globals.hpp"
#include <SFML/Graphics/Shape.hpp>
#include <cmath>

EarthBG::EarthBG()
{
	image = new sf::Image();
	image->LoadFromFile("resources/earth.png");
	sprite = new sf::Sprite();
	sprite->SetImage(*image);
}

EarthBG::~EarthBG()
{
	delete sprite; sprite = 0;
	delete image;  image = 0;
}

void EarthBG::Render(float x, float y, float worldAngle)
{
	sprite->SetPosition( x, y );
	sprite->SetCenter( image->GetWidth() / 2, image->GetHeight() / 2 );
	sprite->SetRotation( worldAngle * 180 / PI );
	g_window->Draw(*sprite);
}
